home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / POVSRC / SOURCE / ImageCompression.h < prev    next >
Text File  |  1993-11-30  |  23KB  |  773 lines

  1. /************************************************************
  2.  
  3. Created: Tuesday, June 8, 1993 at 3:10 PM
  4.  ImageCompression.h
  5.  C Interface to the Macintosh Libraries
  6.  
  7.  Copyright Apple Computer, Inc. 1991, 1992
  8.  All rights reserved
  9.  
  10. ************************************************************/
  11.  
  12. #ifndef __IMAGECOMPRESSION__
  13. #define __IMAGECOMPRESSION__
  14. #ifndef __QUICKDRAW__
  15. #include <QuickDraw.h>
  16. #endif
  17.  
  18. #ifndef __QDOFFSCREEN__
  19. #include <QDOffscreen.h>
  20. #endif
  21.  
  22. #ifndef __TYPES__
  23. #include <Types.h>
  24. #endif
  25.  
  26. #ifndef __COMPONENTS__
  27. #include <Components.h>
  28. #endif
  29.  
  30. #ifndef __STANDARDFILE__
  31. #include <StandardFile.h>
  32. #endif
  33.  
  34.  
  35. #define gestaltCompressionMgr 'icmp'
  36.  
  37.  
  38. struct MatrixRecord {
  39.     Fixed matrix[3][3];
  40. };
  41.  
  42. typedef struct MatrixRecord MatrixRecord;
  43. typedef MatrixRecord *MatrixRecordPtr;
  44.  
  45. typedef struct FixedPoint {
  46.     Fixed x;
  47.     Fixed y;
  48. } FixedPoint;
  49.  
  50. typedef struct FixedRect {
  51.     Fixed left;
  52.     Fixed top;
  53.     Fixed right;
  54.     Fixed bottom;
  55. } FixedRect;
  56.  
  57.  
  58. #define    codecInfoDoes1                (1L<<0)
  59. #define    codecInfoDoes2                (1L<<1)
  60. #define    codecInfoDoes4                (1L<<2)
  61. #define    codecInfoDoes8                (1L<<3)
  62. #define    codecInfoDoes16                (1L<<4)
  63. #define    codecInfoDoes32                (1L<<5)
  64. #define    codecInfoDoesDither            (1L<<6)
  65. #define    codecInfoDoesStretch        (1L<<7)
  66. #define    codecInfoDoesShrink            (1L<<8)
  67. #define    codecInfoDoesMask            (1L<<9)
  68.  
  69. #define    codecInfoDoesTemporal        (1L<<10)
  70.  
  71. #define    codecInfoDoesDouble            (1L<<11)
  72. #define    codecInfoDoesQuad            (1L<<12)
  73. #define    codecInfoDoesHalf            (1L<<13)
  74. #define    codecInfoDoesQuarter        (1L<<14)
  75.  
  76. #define    codecInfoDoesRotate            (1L<<15)
  77. #define    codecInfoDoesHorizFlip        (1L<<16)
  78. #define    codecInfoDoesVertFlip        (1L<<17)
  79. #define    codecInfoDoesSkew            (1L<<18)
  80. #define    codecInfoDoesBlend            (1L<<19)
  81. #define    codecInfoDoesWarp            (1L<<20)
  82. #define    codecInfoDoesRecompress        (1L<<21)
  83. #define    codecInfoDoesSpool            (1L<<22)
  84. #define    codecInfoDoesRateConstrain    (1L<<23)
  85.  
  86. #define    codecInfoDepth1                (1L<<0)
  87. #define    codecInfoDepth2                (1L<<1)
  88. #define    codecInfoDepth4                (1L<<2)
  89. #define    codecInfoDepth8                (1L<<3)
  90. #define    codecInfoDepth16            (1L<<4)
  91. #define    codecInfoDepth32            (1L<<5)
  92. #define    codecInfoDepth24            (1L<<6)
  93. #define    codecInfoDepth33            (1L<<7)
  94. #define    codecInfoDepth34            (1L<<8)
  95. #define    codecInfoDepth36            (1L<<9)
  96. #define    codecInfoDepth40            (1L<<10)
  97. #define    codecInfoStoresClut            (1L<<11)
  98. #define    codecInfoDoesLossless        (1L<<12)
  99. #define    codecInfoSequenceSensitive    (1L<<13)
  100.  
  101. #define    codecFlagUseImageBuffer        (1L<<0)
  102. #define    codecFlagUseScreenBuffer    (1L<<1)
  103. #define    codecFlagUpdatePrevious        (1L<<2)
  104. #define    codecFlagNoScreenUpdate        (1L<<3)
  105. #define    codecFlagWasCompressed        (1L<<4)
  106. #define    codecFlagDontOffscreen        (1L<<5)
  107. #define    codecFlagUpdatePreviousComp    (1L<<6)
  108. #define    codecFlagForceKeyFrame        (1L<<7)
  109. #define    codecFlagOnlyScreenUpdate    (1L<<8)
  110. #define    codecFlagLiveGrab            (1L<<9)
  111. #define    codecFlagDontUseNewImageBuffer (1L<<10)
  112. #define    codecFlagInterlaceUpdate     (1L<<11)
  113.  
  114.  
  115. #define    codecFlagUsedNewImageBuffer    (1L<<14)
  116. #define    codecFlagUsedImageBuffer    (1L<<15)
  117.  
  118. #define    codecErr                    -8960
  119. #define    noCodecErr                    -8961
  120. #define    codecUnimpErr                -8962
  121. #define    codecSizeErr                -8963
  122. #define    codecScreenBufErr            -8964
  123. #define    codecImageBufErr            -8965
  124. #define    codecSpoolErr                -8966
  125. #define    codecAbortErr                -8967
  126. #define    codecWouldOffscreenErr        -8968
  127. #define    codecBadDataErr                -8969
  128. #define    codecDataVersErr            -8970
  129. #define    codecExtensionNotFoundErr    -8971
  130. #define    codecConditionErr            -8972
  131. #define    codecOpenErr                -8973
  132. #define    codecMinimumDataSize        32768
  133.  
  134. #define    compressorComponentType            'imco'
  135. #define    decompressorComponentType        'imdc'
  136.  
  137. typedef    Component        CompressorComponent;
  138. typedef    Component        DecompressorComponent;
  139. typedef    Component        CodecComponent;
  140.  
  141. #define    anyCodec                ((CodecComponent)0)
  142. #define    bestSpeedCodec            ((CodecComponent)-1)
  143. #define    bestFidelityCodec        ((CodecComponent)-2)
  144. #define    bestCompressionCodec    ((CodecComponent)-3)
  145.  
  146. typedef    long        CodecType;
  147.  
  148. typedef    unsigned short    CodecFlags;
  149.  
  150. typedef    unsigned long    CodecQ;
  151.  
  152. #define    codecLosslessQuality        0x400L
  153. #define    codecMaxQuality                0x3ffL
  154. #define    codecMinQuality                0x000L
  155. #define    codecLowQuality                0x100L
  156. #define    codecNormalQuality            0x200L
  157. #define    codecHighQuality            0x300L
  158.  
  159. typedef pascal OSErr (*DataProcPtr)(Ptr *dataP,long bytesNeeded,long refcon);
  160.  
  161. typedef pascal OSErr (*FlushProcPtr)(Ptr data,long bytesAdded,long refcon);
  162.  
  163. typedef pascal void (*CompletionProcPtr)(OSErr result,short flags,long refcon);
  164.  
  165. #define    codecCompletionSource        (1<<0)
  166. #define    codecCompletionDest            (1<<1)
  167.  
  168. typedef pascal OSErr (*ProgressProcPtr)(short message,Fixed completeness,long refcon);
  169.  
  170. #define    codecProgressOpen            0
  171. #define    codecProgressUpdatePercent    1
  172. #define    codecProgressClose            2
  173.  
  174. typedef pascal void (*StdPixProcPtr)(PixMap *src,Rect *srcRect,MatrixRecord *matrix,short mode,
  175.     RgnHandle mask,PixMap *matte,Rect *matteRect,short flags);
  176.  
  177. typedef    long ImageSequence;
  178.  
  179. typedef    struct {
  180.     ProgressProcPtr    progressProc;
  181.     long            progressRefCon;
  182. } ProgressProcRecord;
  183.  
  184. typedef    ProgressProcRecord    *ProgressProcRecordPtr;
  185.  
  186. typedef    struct {
  187.     CompletionProcPtr    completionProc;
  188.     long                completionRefCon;
  189. } CompletionProcRecord;
  190.  
  191. typedef    CompletionProcRecord    *CompletionProcRecordPtr;
  192.  
  193. typedef    struct {
  194.     DataProcPtr        dataProc;
  195.     long            dataRefCon;
  196. } DataProcRecord;
  197.  
  198. typedef    DataProcRecord    *DataProcRecordPtr;
  199.  
  200. typedef    struct {
  201.     FlushProcPtr    flushProc;
  202.     long            flushRefCon;
  203. } FlushProcRecord;
  204.  
  205. typedef    FlushProcRecord    *FlushProcRecordPtr;
  206.  
  207. typedef pascal void (*AlignmentProcPtr)(Rect *rp, long refcon);
  208.  
  209. typedef    struct {
  210.     AlignmentProcPtr    alignmentProc;
  211.     long                alignmentRefCon;
  212. } AlignmentProcRecord;
  213.  
  214. typedef    AlignmentProcRecord    *AlignmentProcRecordPtr;
  215.  
  216. typedef struct {
  217.     long    dataRate;
  218.     long    dataOverrun;
  219.     long    frameDuration;
  220.     long    keyFrameRate;
  221.     CodecQ    minSpatialQuality;
  222.     CodecQ    minTemporalQuality;
  223. } DataRateParams;
  224.  
  225. typedef     DataRateParams *DataRateParamsPtr;
  226.  
  227. typedef struct ImageDescription {
  228.     long        idSize;
  229.     CodecType    cType;
  230.     long        resvd1;
  231.     short        resvd2;
  232.     short        dataRefIndex;
  233.     short        version;
  234.     short        revisionLevel;
  235.     long        vendor;
  236.     CodecQ        temporalQuality;
  237.     CodecQ        spatialQuality;
  238.     short        width;
  239.     short        height;
  240.     Fixed        hRes;
  241.     Fixed        vRes;
  242.     long        dataSize;
  243.     short        frameCount;
  244.     Str31        name;
  245.     short        depth;
  246.     short        clutID;
  247. } ImageDescription;
  248.  
  249. typedef    ImageDescription    *ImageDescriptionPtr;
  250.  
  251. typedef    ImageDescription    **ImageDescriptionHandle;
  252.  
  253. typedef struct CodecInfo {
  254.     Str31             typeName;
  255.     short            version;
  256.     short            revisionLevel;
  257.     long            vendor;
  258.     long             decompressFlags;
  259.     long             compressFlags;
  260.     long             formatFlags;
  261.     unsigned char    compressionAccuracy;
  262.     unsigned char    decompressionAccuracy;
  263.     unsigned short    compressionSpeed;
  264.     unsigned short    decompressionSpeed;
  265.     unsigned char    compressionLevel;
  266.     char            resvd;
  267.     short            minimumHeight;
  268.     short            minimumWidth;
  269.     short            decompressPipelineLatency;
  270.     short            compressPipelineLatency;
  271.     long            privateData;
  272. } CodecInfo;
  273.  
  274. typedef    struct {
  275.     CodecComponent        codec;
  276.     CodecType        cType;
  277.     Str31            typeName;
  278.     Handle            name;
  279. } CodecNameSpec;
  280.  
  281. typedef    struct {
  282.     short            count;
  283.     CodecNameSpec    list[1];
  284. }CodecNameSpecList;
  285.  
  286. typedef    CodecNameSpecList *CodecNameSpecListPtr;
  287.  
  288. #define    defaultDither        0
  289. #define    forceDither            1
  290. #define    suppressDither        2
  291. #define    useColorMatching    4
  292.  
  293. #ifdef __cplusplus
  294. extern "C" {
  295. #endif __cplusplus
  296.  
  297. pascal    OSErr
  298. CodecManagerVersion(long *version)
  299.     = {0x7000,0xAAA3};
  300.     
  301. pascal OSErr
  302. GetCodecNameList(CodecNameSpecListPtr *list,short showAll)
  303.     = {0x7001,0xAAA3};
  304.  
  305. pascal OSErr
  306. DisposeCodecNameList(CodecNameSpecListPtr list)
  307.     = {0x700F,0xAAA3};
  308.  
  309. pascal    OSErr
  310. GetCodecInfo(CodecInfo *info,CodecType cType,CodecComponent codec)
  311.     = {0x7003,0xAAA3};
  312.  
  313. pascal OSErr
  314. GetMaxCompressionSize(PixMapHandle src,const Rect *srcRect, short colorDepth,CodecQ quality,
  315.         CodecType cType,CompressorComponent codec,long *size)
  316.     = {0x7004,0xAAA3};
  317.  
  318. pascal OSErr
  319. GetCompressionTime(PixMapHandle src,const Rect *srcRect, short colorDepth,
  320.         CodecType cType,CompressorComponent codec,
  321.         CodecQ *spatialQuality,CodecQ *temporalQuality,unsigned long *compressTime)
  322.     = {0x7005,0xAAA3};
  323.  
  324. pascal OSErr
  325. CompressImage(PixMapHandle src,const Rect *srcRect,CodecQ quality,CodecType cType,
  326.         ImageDescriptionHandle desc,Ptr data)
  327.     = {0x7006,0xAAA3};
  328.  
  329. pascal OSErr
  330. FCompressImage(PixMapHandle src,const Rect *srcRect, short colorDepth,
  331.         CodecQ quality,CodecType cType,CompressorComponent codec,CTabHandle clut,
  332.         CodecFlags flags,long bufferSize,
  333.         FlushProcRecordPtr flushProc,ProgressProcRecordPtr progressProc, ImageDescriptionHandle desc,Ptr data)
  334.     = {0x7007,0xAAA3};
  335.  
  336. pascal OSErr
  337. DecompressImage(Ptr data,ImageDescriptionHandle desc,PixMapHandle dst,
  338.         const Rect *srcRect,const Rect *dstRect,short mode,RgnHandle mask)
  339.     = {0x7008,0xAAA3};
  340.  
  341. pascal OSErr
  342. FDecompressImage(Ptr data,ImageDescriptionHandle desc,PixMapHandle dst,const Rect *srcRect,
  343.         MatrixRecordPtr matrix,short mode,RgnHandle mask,
  344.         PixMapHandle matte,const Rect *matteRect,
  345.         CodecQ accuracy,DecompressorComponent codec,
  346.         long bufferSize,DataProcRecordPtr dataProc,ProgressProcRecordPtr progressProc)
  347.     = {0x7009,0xAAA3};
  348.  
  349. pascal OSErr
  350. CompressSequenceBegin(ImageSequence *seqID,PixMapHandle src,PixMapHandle prev,
  351.         const Rect *srcRect,const Rect *prevRect,short colorDepth,CodecType cType,CompressorComponent codec,
  352.         CodecQ spatialQuality,CodecQ temporalQuality,long keyFrameRate,
  353.         CTabHandle clut,CodecFlags flags,ImageDescriptionHandle desc)
  354.     = {0x700A,0xAAA3};
  355.  
  356. pascal OSErr
  357. CompressSequenceFrame(ImageSequence seqID,PixMapHandle src,const Rect *srcRect,
  358.         CodecFlags flags,Ptr data,long *dataSize,
  359.         unsigned char *similarity,CompletionProcRecordPtr asyncCompletionProc)
  360.     = {0x700B,0xAAA3};
  361.  
  362. pascal OSErr
  363. DecompressSequenceBegin(ImageSequence *seqID,ImageDescriptionHandle desc,
  364.         CGrafPtr port,GDHandle gdh,const Rect *srcRect,MatrixRecordPtr matrix,
  365.         short mode,RgnHandle mask,CodecFlags flags,CodecQ accuracy,DecompressorComponent codec)
  366.     = {0x700D,0xAAA3};
  367.  
  368. pascal OSErr
  369. DecompressSequenceBeginS(ImageSequence *seqID,ImageDescriptionHandle desc,Ptr data,long dataSize,
  370.         CGrafPtr port,GDHandle gdh,const Rect *srcRect,MatrixRecordPtr matrix,
  371.         short mode,RgnHandle mask,CodecFlags flags,CodecQ accuracy,DecompressorComponent codec)
  372.     = {0x203C,0x30,0x5D,0xAAA3};
  373.  
  374. pascal OSErr
  375. DecompressSequenceFrame(ImageSequence seqID,Ptr data,
  376.         CodecFlags inFlags,CodecFlags *outFlags,CompletionProcRecordPtr asyncCompletionProc)
  377.     = {0x700E,0xAAA3};
  378.  
  379. pascal OSErr
  380. DecompressSequenceFrameS(ImageSequence seqID,Ptr data,long dataSize,
  381.         CodecFlags inFlags,CodecFlags *outFlags,CompletionProcRecordPtr asyncCompletionProc)
  382.     = {0x203C,0x16,0x47,0xAAA3};
  383.  
  384. pascal OSErr
  385. SetDSequenceMatrix(ImageSequence seqID,MatrixRecordPtr matrix)
  386.     = {0x7010,0xAAA3};
  387.  
  388. pascal OSErr
  389. SetDSequenceMatte(ImageSequence seqID,PixMapHandle matte,const Rect *matteRect)
  390.     = {0x7011,0xAAA3};
  391.  
  392. pascal OSErr
  393. SetDSequenceMask(ImageSequence seqID,RgnHandle mask)
  394.     = {0x7012,0xAAA3};
  395.  
  396. pascal OSErr
  397. SetDSequenceTransferMode(ImageSequence seqID,short mode,const RGBColor *opColor)
  398.     = {0x7013,0xAAA3};
  399.  
  400. pascal OSErr
  401. SetDSequenceDataProc(ImageSequence seqID,DataProcRecordPtr dataProc,long bufferSize)
  402.     = {0x7014,0xAAA3};
  403.  
  404. pascal OSErr
  405. SetDSequenceAccuracy(ImageSequence seqID,CodecQ accuracy)
  406.     = {0x7034,0xAAA3};
  407.  
  408. pascal OSErr
  409. SetDSequenceSrcRect(ImageSequence seqID,const Rect *srcRect)
  410.     = {0x7035,0xAAA3};
  411.  
  412. pascal OSErr
  413. GetDSequenceImageBuffer(ImageSequence seqID,GWorldPtr *gworld)
  414.     = {0x7015,0xAAA3};
  415.  
  416. pascal OSErr
  417. GetDSequenceScreenBuffer(ImageSequence seqID,GWorldPtr *gworld)
  418.     = {0x7016,0xAAA3};
  419.  
  420. pascal OSErr
  421. SetCSequenceQuality(ImageSequence seqID,CodecQ spatialQuality,CodecQ temporalQuality)
  422.     = {0x7017,0xAAA3};
  423.  
  424. pascal OSErr
  425. SetCSequencePrev(ImageSequence seqID,PixMapHandle prev,const Rect *prevRect)
  426.     = {0x7018,0xAAA3};
  427.  
  428. pascal OSErr
  429. SetCSequenceFlushProc(ImageSequence seqID,FlushProcRecordPtr flushProc,long bufferSize)
  430.     = {0x7033,0xAAA3};
  431.  
  432. pascal OSErr
  433. SetCSequenceKeyFrameRate(ImageSequence seqID,long keyframerate)
  434.     = {0x7036,0xAAA3};
  435.  
  436. pascal OSErr
  437. GetCSequenceKeyFrameRate(ImageSequence seqID,long *keyframerate)
  438.     = {0x203C,0x8,0x4B,0xAAA3};
  439.  
  440. pascal OSErr
  441. GetCSequencePrevBuffer(ImageSequence seqID,GWorldPtr *gworld)
  442.     = {0x7019,0xAAA3};
  443.  
  444. pascal OSErr
  445. CDSequenceBusy(ImageSequence seqID)
  446.     = {0x701A,0xAAA3};
  447.  
  448. pascal OSErr
  449. CDSequenceEnd(ImageSequence seqID)
  450.     = {0x701B,0xAAA3};
  451.  
  452. pascal OSErr
  453. GetCompressedImageSize(ImageDescriptionHandle desc,Ptr data,long bufferSize,
  454.         DataProcRecordPtr dataProc,long *dataSize)
  455.     = {0x701C,0xAAA3};
  456.  
  457. pascal OSErr
  458. GetSimilarity(PixMapHandle src,const Rect *srcRect,ImageDescriptionHandle desc,Ptr data,Fixed *similarity)
  459.     = {0x701D,0xAAA3};
  460.  
  461. pascal OSErr
  462. GetImageDescriptionCTable(ImageDescriptionHandle desc,CTabHandle *ctable)
  463.     = {0x701E,0xAAA3};
  464.  
  465. pascal OSErr
  466. SetImageDescriptionCTable(ImageDescriptionHandle desc,CTabHandle ctable)
  467.     = {0x701F,0xAAA3};
  468.  
  469. pascal OSErr
  470. GetImageDescriptionExtension(ImageDescriptionHandle desc,Handle *extension,long type,long index)
  471.     = {0x7020,0xAAA3};
  472.  
  473. pascal OSErr
  474. SetImageDescriptionExtension(ImageDescriptionHandle desc,Handle extension, long type)
  475.     = {0x7021,0xAAA3};
  476.  
  477. pascal OSErr
  478. RemoveImageDescriptionExtension(ImageDescription **desc, long type, long index)
  479.     = {0x203C,0xC,0x3A,0xAAA3};
  480.  
  481. pascal OSErr
  482. CountImageDescriptionExtensionType(ImageDescription **desc, long type, long *count)
  483.     = {0x203C,0xC,0x3B,0xAAA3};
  484.  
  485. pascal OSErr
  486. GetNextImageDescriptionExtensionType(ImageDescription **desc, long *type)
  487.     = {0x203C,0x8,0x3C,0xAAA3};
  488.  
  489. pascal OSErr
  490. FindCodec(CodecType cType,CodecComponent specCodec,
  491.         CompressorComponent *compressor,DecompressorComponent *decompressor)
  492.     = {0x7023,0xAAA3};
  493.  
  494. pascal OSErr
  495. CompressPicture(PicHandle srcPicture, PicHandle dstPicture,CodecQ quality,CodecType cType)
  496.     = {0x7024,0xAAA3};
  497.  
  498. pascal OSErr
  499. FCompressPicture(PicHandle srcPicture, PicHandle dstPicture,
  500.         short colorDepth, CTabHandle clut,CodecQ quality,
  501.         short doDither,short compressAgain,ProgressProcRecordPtr progressProc,
  502.         CodecType cType,CompressorComponent codec)
  503.     = {0x7025,0xAAA3};
  504.  
  505. pascal OSErr
  506. CompressPictureFile(short srcRefNum, short dstRefNum,CodecQ quality,CodecType cType)
  507.     = {0x7026,0xAAA3};
  508.  
  509. pascal OSErr
  510. FCompressPictureFile(short srcRefNum, short dstRefNum,short colorDepth, CTabHandle clut,
  511.     CodecQ quality, short doDither,short compressAgain,ProgressProcRecordPtr progressProc,
  512.     CodecType cType,CompressorComponent codec)
  513.     = {0x7027,0xAAA3};
  514.  
  515. pascal OSErr
  516. GetPictureFileHeader(short refNum,Rect *frame,OpenCPicParams *header)
  517.     = {0x7028,0xAAA3};
  518.  
  519. pascal OSErr
  520. DrawPictureFile(short refNum,const Rect *frame,ProgressProcRecordPtr progressProc)
  521.     = {0x7029,0xAAA3};
  522.  
  523. pascal OSErr
  524. DrawTrimmedPicture(PicHandle srcPicture,const Rect *frame,RgnHandle trimMask,short doDither,
  525.         ProgressProcRecordPtr progressProc)
  526.     = {0x702E,0xAAA3};
  527.  
  528. pascal OSErr
  529. DrawTrimmedPictureFile(short srcRefnum,const Rect *frame,RgnHandle trimMask,short doDither,
  530.         ProgressProcRecordPtr progressProc)
  531.     = {0x702F,0xAAA3};
  532.  
  533. pascal OSErr
  534. MakeThumbnailFromPicture(PicHandle picture,short colorDepth,PicHandle thumbnail,
  535.         ProgressProcRecordPtr progressProc)
  536.     = {0x702A,0xAAA3};
  537.  
  538. pascal OSErr
  539. MakeThumbnailFromPictureFile(short refNum,short colorDepth,PicHandle thumbnail,
  540.         ProgressProcRecordPtr progressProc)
  541. = {0x702B,0xAAA3};
  542.  
  543. pascal OSErr
  544. MakeThumbnailFromPixMap(PixMapHandle src,const Rect *srcRect,short colorDepth,PicHandle thumbnail,
  545.         ProgressProcRecordPtr progressProc)
  546. = {0x702C,0xAAA3};
  547.  
  548. pascal OSErr
  549. TrimImage(ImageDescriptionHandle desc,Ptr inData,long inBufferSize,DataProcRecordPtr dataProc,
  550.         Ptr    outData,long outBufferSize,FlushProcRecordPtr flushProc,Rect *trimRect,
  551.         ProgressProcRecordPtr progressProc)
  552.     = {0x702D,0xAAA3};
  553.  
  554. pascal OSErr
  555. ConvertImage(ImageDescriptionHandle srcDD,Ptr srcData,short colorDepth,CTabHandle clut,
  556.         CodecQ accuracy,CodecQ quality,CodecType cType,CodecComponent codec,
  557.         ImageDescriptionHandle dstDD,Ptr dstData)
  558.     = {0x7030,0xAAA3};
  559.  
  560. pascal OSErr
  561. GetCompressedPixMapInfo(PixMapPtr pix,ImageDescriptionHandle *desc,Ptr *data,long *bufferSize,
  562.     DataProcRecord *dataProc,ProgressProcRecord *progressProc)
  563.     = {0x7037,0xAAA3};
  564.  
  565. pascal OSErr
  566. SetCompressedPixMapInfo(PixMapPtr pix,ImageDescriptionHandle desc,Ptr data,long bufferSize,
  567.     DataProcRecordPtr dataProc,ProgressProcRecordPtr progressProc)
  568.     = {0x7038,0xAAA3};
  569.  
  570. pascal void
  571. StdPix(PixMapPtr src,const Rect *srcRect,MatrixRecordPtr matrix,short mode,
  572.     RgnHandle mask,PixMapPtr matte,const Rect *matteRect,short flags)
  573.      = {0x700C,0xAAA3};
  574.  
  575. pascal OSErr
  576. TransformRgn(MatrixRecordPtr matrix, RgnHandle rgn)
  577.     = {0x7039,0xAAA3};
  578.  
  579. /***********
  580.     preview stuff
  581. ***********/
  582.  
  583. pascal void SFGetFilePreview(Point where,
  584.                       ConstStr255Param prompt,
  585.                       FileFilterProcPtr fileFilter,
  586.                       short numTypes,
  587.                       SFTypeList typeList,
  588.                       DlgHookProcPtr dlgHook,
  589.                       SFReply *reply)
  590.  = {0x303C,0x41,0xAAA3};
  591.  
  592. pascal void SFPGetFilePreview(Point where,
  593.                        ConstStr255Param prompt,
  594.                        FileFilterProcPtr fileFilter,
  595.                        short numTypes,
  596.                        SFTypeList typeList,
  597.                        DlgHookProcPtr dlgHook,
  598.                        SFReply *reply,
  599.                        short dlgID,
  600.                        ModalFilterProcPtr filterProc)
  601.  = {0x303C,0x42,0xAAA3};
  602.  
  603. pascal void StandardGetFilePreview(FileFilterProcPtr fileFilter,
  604.                             short numTypes,
  605.                             SFTypeList typeList,
  606.                             StandardFileReply *reply)
  607.  = {0x303C,0x43,0xAAA3};
  608.  
  609. pascal void CustomGetFilePreview(FileFilterYDProcPtr fileFilter,
  610.                           short numTypes,
  611.                           SFTypeList typeList,
  612.                           StandardFileReply *reply,
  613.                           short dlgID,
  614.                           Point where,
  615.                           DlgHookYDProcPtr dlgHook,
  616.                           ModalFilterYDProcPtr filterProc,
  617.                           short *activeList,
  618.                           ActivateYDProcPtr activateProc,
  619.                           void *yourDataPtr)
  620.  = {0x303C,0x44,0xAAA3};
  621.  
  622. pascal OSErr MakeFilePreview(short resRefNum, ProgressProcRecordPtr progress)
  623.  = {0x303C,0x45,0xAAA3};
  624.  
  625. pascal OSErr AddFilePreview(short resRefNum, OSType previewType, Handle previewData)
  626.  = {0x303C,0x46,0xAAA3};
  627.  
  628. #ifdef __cplusplus
  629. }
  630. #endif __cplusplus
  631.  
  632. enum {
  633.     sfpItemPreviewAreaUser = 11,
  634.     sfpItemPreviewStaticText = 12,
  635.     sfpItemPreviewDividerUser = 13,
  636.     sfpItemCreatePreviewButton = 14,
  637.     sfpItemShowPreviewButton = 15
  638. };
  639.  
  640. typedef struct {
  641.     unsigned long    modDate;
  642.     short            version;
  643.     OSType            resType;
  644.     short            resID;
  645. } PreviewResourceRecord;
  646. typedef PreviewResourceRecord *PreviewResourcePtr,  **PreviewResource;
  647.  
  648. #ifdef __cplusplus
  649. extern "C" {
  650. #endif __cplusplus
  651.  
  652. pascal void
  653. AlignScreenRect(Rect *rp, AlignmentProcRecordPtr alignmentProc)
  654.     = {0x203C,0x8,0x4C,0xAAA3};
  655.  
  656. pascal void
  657. AlignWindow(WindowPtr wp, Boolean front, const Rect *alignmentRect, AlignmentProcRecordPtr alignmentProc)
  658.     = {0x203C,0xE,0x4D,0xAAA3};
  659.  
  660. pascal void
  661. DragAlignedWindow(WindowPtr wp, Point startPt, Rect *boundsRect, Rect *alignmentRect, AlignmentProcRecordPtr alignmentProc)
  662.     = {0x203C,0x14,0x4E,0xAAA3};
  663.  
  664. pascal long
  665. DragAlignedGrayRgn(RgnHandle theRgn, Point startPt, Rect *boundsRect,
  666.     Rect *slopRect, short axis, ProcPtr actionProc, Rect *alignmentRect, AlignmentProcRecordPtr alignmentProc)
  667.     = {0x203C,0x1E,0x4F,0xAAA3};
  668.  
  669. pascal OSErr
  670. SetCSequenceDataRateParams(ImageSequence seqID,DataRateParamsPtr params)
  671.     = {0x203C,0x8,0x50,0xAAA3};
  672.  
  673. pascal OSErr
  674. SetCSequenceFrameNumber(ImageSequence seqID, long frameNumber)
  675.     = {0x203C,0x8,0x51,0xAAA3};
  676.  
  677. pascal QDErr
  678. NewImageGWorld(GWorldPtr *gworld,ImageDescription **idh,GWorldFlags flags)
  679.     = {0x203C,0xC,0x52,0xAAA3};
  680.  
  681. pascal OSErr
  682. GetCSequenceDataRateParams(ImageSequence seqID,DataRateParamsPtr params)
  683.     = {0x203C,0x8,0x53,0xAAA3};
  684.  
  685. pascal OSErr
  686. GetCSequenceFrameNumber(ImageSequence seqID,long *frameNumber)
  687.     = {0x203C,0x8,0x54,0xAAA3};
  688.  
  689. pascal OSErr
  690. GetBestDeviceRect(GDHandle *gdh, Rect *rp)
  691.     = {0x203C,0x8,0x55,0xAAA3};
  692.  
  693. pascal OSErr
  694. SetSequenceProgressProc(ImageSequence seqID, ProgressProcRecord *progressProc)
  695.     = {0x203C,0x8,0x56,0xAAA3};
  696.  
  697. pascal OSErr
  698. GDHasScale(GDHandle gdh,short depth,Fixed *scale)
  699.     = {0x203C,0xA,0x5A,0xAAA3};
  700.  
  701. pascal OSErr
  702. GDGetScale(GDHandle gdh,Fixed *scale,short *flags)
  703.     = {0x203C,0xC,0x5B,0xAAA3};
  704.  
  705. pascal OSErr
  706. GDSetScale(GDHandle gdh,Fixed scale,short flags)
  707.     = {0x203C,0xA,0x5C,0xAAA3};
  708.  
  709. #ifdef __cplusplus
  710. }
  711. #endif __cplusplus
  712.  
  713.  
  714. enum {
  715.     identityMatrixType            = 0x00,        /* result if matrix is identity */
  716.     translateMatrixType            = 0x01,        /* result if matrix translates */
  717.     scaleMatrixType             = 0x02,        /* result if matrix scales */
  718.     scaleTranslateMatrixType    = 0x03,        /* result if matrix scales and translates */
  719.     linearMatrixType            = 0x04,        /* result if matrix is general 2 x 2 */
  720.     linearTranslateMatrixType    = 0x05,        /* result if matrix is general 2 x 2 and translates */
  721.     perspectiveMatrixType        = 0x06        /* result if matrix is general 3 x 3 */
  722. };
  723. typedef unsigned short MatrixFlags;
  724.  
  725.  
  726.  
  727. #ifdef __cplusplus
  728. extern "C" {
  729. #endif __cplusplus
  730. pascal short    GetMatrixType(MatrixRecord *m)
  731.         = {0x7014,0xABC2};
  732. pascal void        CopyMatrix(MatrixRecord *m1, MatrixRecord *m2)
  733.         = {0x7020,0xABC2};
  734. pascal Boolean    EqualMatrix(const MatrixRecord *m1, const MatrixRecord *m2)
  735.         = {0x7021,0xABC2};
  736.  
  737. pascal void        SetIdentityMatrix( MatrixRecord *matrix )
  738.         = {0x7015,0xABC2};
  739. pascal void        TranslateMatrix( MatrixRecord *m, Fixed deltaH, Fixed deltaV )
  740.         = {0x7019,0xABC2};
  741. pascal void        RotateMatrix( MatrixRecord *m, Fixed degrees, Fixed aboutX, Fixed aboutY )
  742.         = {0x7016,0xABC2};
  743. pascal void        ScaleMatrix( MatrixRecord *m, Fixed scaleX, Fixed scaleY, Fixed aboutX, Fixed aboutY )
  744.         = {0x7017,0xABC2};
  745. pascal void        SkewMatrix(MatrixRecord *m, Fixed skewX, Fixed skewY, Fixed aboutX, Fixed aboutY)
  746.         = {0x7018,0xABC2};
  747.  
  748. pascal OSErr    TransformFixedPoints(MatrixRecord *m, FixedPoint *fpt, long count)
  749.         = {0x7022,0xABC2};
  750. pascal OSErr    TransformPoints( MatrixRecord *mp, Point *pt1, long count )
  751.         = {0x7023,0xABC2};
  752. pascal Boolean    TransformFixedRect(MatrixRecord *m, FixedRect *fr, FixedPoint *fpp)
  753.         = {0x7024,0xABC2};
  754. pascal Boolean    TransformRect(MatrixRecord *m, Rect *r, FixedPoint *fpp)
  755.         = {0x7025,0xABC2};
  756.  
  757. pascal Boolean    InverseMatrix(MatrixRecord *m, MatrixRecord *im)
  758.         = {0x701C,0xABC2};
  759. pascal void        ConcatMatrix(MatrixRecord *a, MatrixRecord *b)
  760.         = {0x701B,0xABC2};
  761.  
  762. pascal void        RectMatrix(MatrixRecord *matrix,Rect *srcRect,Rect *dstRect)
  763.         = {0x701E,0xABC2};
  764. pascal void        MapMatrix(MatrixRecord *matrix,Rect *fromRect,Rect *toRect)
  765.         = {0x701D,0xABC2};
  766.  
  767. #ifdef __cplusplus
  768. }
  769. #endif __cplusplus
  770.  
  771.  
  772. #endif __IMAGECOMPRESSION__
  773.